package com.coder520.poi_hibernate.user.service;

import java.util.List;

import org.aspectj.weaver.patterns.ThisOrTargetAnnotationPointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.coder520.poi_hibernate.user.dao.UserDao;
import com.coder520.poi_hibernate.user.entity.User;


@Service
public class UserServiceImpl implements UserService{
	@Autowired
	private UserDao userDao;
	
	@Override
	public User selectUserById(Integer id) {
		User user=userDao.selectUserById(id);
		return user;
	}
	@Override
	public List<User> selectAllUser() {
		// TODO Auto-generated method stub
		List<User> users=userDao.selectAllUser();
		return users;
	}
	
	@Override
	public void saveUser(User user) {
		// TODO Auto-generated method stub
		userDao.saveUser(user);
	}
	@Override
	public void updateUser(User user) {
		// TODO Auto-generated method stub
		userDao.updateUser(user);
	}
	@Override
	public List<Integer> getId() {
		// TODO Auto-generated method stub
		
		return userDao.getId();
	}
	@Override
	public void saveOrUpdate(User user) {
		// TODO Auto-generated method stub
		userDao.saveOrUpdate(user);
	}
}
